/**
 * 2018年12月4日上午10:23:14
 * @author 谢进财
 */
package com.baihang.project.ds.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baihang.framework.controller.BaseController;
import com.baihang.project.ds.service.ReportService;

/**
 * 报表
 *
 */
@Controller
@RequestMapping("/report")
public class ReportController extends BaseController {
	@Autowired
	private ReportService service;
	
	@RequestMapping
	public String index() {
		return "/project/ds/report/index";
	}
	
	@RequestMapping(value ="/getGrid", produces="application/json;charset=UTF-8")
	@ResponseBody
	public String getGrid() {
		String grid = service.getGrid();
		//System.out.println(grid);
		return grid;
	}
	
	@RequestMapping(value ="/getGridByLd", produces="application/json;charset=UTF-8")
	@ResponseBody
	public String getGridByLd(int id) {
		String grid = service.getGridByLd(id);
		//System.out.println(grid);
		return grid;
	}
	//导出销售报表
	@RequestMapping("/GetExcel")
	public ResponseEntity<byte[]> GetExcel() throws Exception{	
		return service.GetExcel();
	}
}
